UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oM/fnVb4aZ7d7MnHR0KR2nLfe287jVzHlZO56qcim9c='
WHERE
key_id = 'cfa1adab27452279485112b39d95667eb83ed0fde386c4380d2a926659d0d41c'
AND (
token = 'oM/fnVb4aZ7d7MnHR0KR2nLfe287jVzHlZO56qcim9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)