UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rM4l6WxoxSajZ1QlQ26HlMuVD53kIjBNTzEeQJLTebg=' 
WHERE 
  key_id = 'bfee5bfaf4fe9bb676705b77de39a3f6219a73992fcbef8ec1facd99307a11e4' 
  AND (
    token = 'rM4l6WxoxSajZ1QlQ26HlMuVD53kIjBNTzEeQJLTebg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018