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

Query time 0.00023