UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3gtRhDritpqtJkXGzjh/AuH4J2iEZ1zqTN+vaQ0wDMI='
WHERE
key_id = 'e28c503e34a8606ef6b1679d5a8d8d8954d31cb3eaef30fe2afc7031a067c201'
AND (
token = '3gtRhDritpqtJkXGzjh/AuH4J2iEZ1zqTN+vaQ0wDMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)