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