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