UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kK9C5f1tKZtcJcJTSAPBWK/HMt5SOfBsC6BVeVOhZzE='
WHERE
key_id = 'b0fb75916fc5166f1c4fe438e01878be62bc8ae1eb225d152fd1133495addc5d'
AND (
token = 'kK9C5f1tKZtcJcJTSAPBWK/HMt5SOfBsC6BVeVOhZzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)