UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xqg4Q8A0OkAwTgX0Vx+ietcwl+z1/9wMBLj4d9/ub88='
WHERE
key_id = 'd1404418edd35589f54a86f9ce2431ff9cbadcfed6ac3f1fd06fbcf2daac32d9'
AND (
token = 'xqg4Q8A0OkAwTgX0Vx+ietcwl+z1/9wMBLj4d9/ub88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)