UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UxzNk6fSslxr2IDjx3tK2qSIkmwJTNDUxmsCm4K0jNE='
WHERE
key_id = 'c52dd169092ae0205b7c1431ba243ebce6495a1c4e0b4d7f99b086bddc7488fa'
AND (
token = 'UxzNk6fSslxr2IDjx3tK2qSIkmwJTNDUxmsCm4K0jNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)