UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Srz7y7Sgzmuq8iJOufHIhu9oG6jArTUun5H61JqyTK8='
WHERE
key_id = '4ba67227ed2888a8992e69535b5fa3421e5bd0d040b4155ce3b43baf3ca41720'
AND (
token = 'Srz7y7Sgzmuq8iJOufHIhu9oG6jArTUun5H61JqyTK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)