UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jBnol1WnxlPP/NK2ehNdf0WMp1ThOcaA9uFe5mxD+fQ='
WHERE
key_id = 'a0cd2304cbcaead6c1392de838700c6df8edf23e0ba94da95959f6414ba1c46e'
AND (
token = 'jBnol1WnxlPP/NK2ehNdf0WMp1ThOcaA9uFe5mxD+fQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)