UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ocKdYPf1wp6hQgIC7R+RWa31cwiC/zE1WtbRFbcAWSc='
WHERE
key_id = 'ab5cd11e6e339907f9f4d5b330ddddb5598be579311031141e543ffb1f4b118a'
AND (
token = 'ocKdYPf1wp6hQgIC7R+RWa31cwiC/zE1WtbRFbcAWSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)