UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FMk++QkADS4KeF41Trl80cDoxJRjU92thxj7aww4sI4='
WHERE
key_id = '804bc53663e94885862d304c34e838e75a4ce7dd15c410c04f91e2d15f787f9f'
AND (
token = 'FMk++QkADS4KeF41Trl80cDoxJRjU92thxj7aww4sI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)