UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h0SEVA/DcNLIDGJJ6mUorJ4jeV06G0aGAv6aSyKJ5L4='
WHERE
key_id = '6cf124a9f8a7a7faeef05bfd1762d6af9c34249ce14b3a6a1628f93122f271ae'
AND (
token = 'h0SEVA/DcNLIDGJJ6mUorJ4jeV06G0aGAv6aSyKJ5L4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)