UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YQxXzYJ0jpv74PoQpJV4u+ZTZuvLHTRUhTRnnAP/4I4='
WHERE
key_id = '274cf27f614bc8eb792839319e070f61aac6ec1886db80ac87b4cf11908cd700'
AND (
token = 'YQxXzYJ0jpv74PoQpJV4u+ZTZuvLHTRUhTRnnAP/4I4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)