UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vq6qBdorJqkpGtqie1c0VocQUNhrckzSkD6Xz0KKGR4=' 
WHERE 
  key_id = '01c478074371d6543944598777af43805c6606da7704743bd218f0c4ba9dbd58' 
  AND (
    token = 'vq6qBdorJqkpGtqie1c0VocQUNhrckzSkD6Xz0KKGR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027