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