UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GMEhM52zP7vWtqCIgnvB4AtTGpNPGewImcwppjxOBJ0='
WHERE
key_id = '0612f7cbbae0d96fa418333748d0d12a01b2a47e9cf274a5c2ed727fdb3109b0'
AND (
token = 'GMEhM52zP7vWtqCIgnvB4AtTGpNPGewImcwppjxOBJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)