UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gouFhpdncGpPYSuUfbFK4uoQA+8dqtbBlIIddZ15slU=' 
WHERE 
  key_id = '19c30649297a9b754ac58c49d394f3218a665da49ee769a7bfb3a62b1097eb18' 
  AND (
    token = 'gouFhpdncGpPYSuUfbFK4uoQA+8dqtbBlIIddZ15slU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029