UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Ap8RdocVfqWmIi7JdoPCq58SzpysJxirBZN43qWo3M=' 
WHERE 
  key_id = 'cbdb4386b73e5c97f949ba529e2012c640155fc6330bc9dc183d6969fca2d0c9' 
  AND (
    token = '9Ap8RdocVfqWmIi7JdoPCq58SzpysJxirBZN43qWo3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016