UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFXBld3q//FjcrpOLvEwz27A6ePWGoQvygCqdTKvjL0='
WHERE
key_id = 'f5a79f07ac217c1a12eda154857f8bbb001f388ff7aff97be2e1af90c9aa30de'
AND (
token = 'qFXBld3q//FjcrpOLvEwz27A6ePWGoQvygCqdTKvjL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)