UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OmoSmSaqv14FZsN9PxV77MGT8E6vSqS0mRl1RVxrN+8='
WHERE
key_id = '721a8157c0977b0e6b924dfa54b720f2655eb703a9ccbc21eec68b250621c4ff'
AND (
token = 'OmoSmSaqv14FZsN9PxV77MGT8E6vSqS0mRl1RVxrN+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)