UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rD1kwAffN/rYedD9PEoQEL6t7SFWmsQfS7Tp7nU2KIg='
WHERE
key_id = '4bfdad755b51c4caf961edbdebf9d0e5b817d5e46f12c34207813b2c2c576bb2'
AND (
token = 'rD1kwAffN/rYedD9PEoQEL6t7SFWmsQfS7Tp7nU2KIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)