UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fdDdjRETifBwxbDd70D3JVaBkWaeiLO9d217W/yXGB0='
WHERE
key_id = '35798a572e4ac98a3558e30598fbc42ad614448aeb3c8312c1c60a60907afa62'
AND (
token = 'fdDdjRETifBwxbDd70D3JVaBkWaeiLO9d217W/yXGB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)