UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lb1UOfGLo8l8+pWyLeX9SIAw62lC771DE+aaKWSpQK0='
WHERE
key_id = '4b4384a60c030537cd6d53c001f23407941d927dffb97e1a197e0a8059f4cc7b'
AND (
token = 'Lb1UOfGLo8l8+pWyLeX9SIAw62lC771DE+aaKWSpQK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)