UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DunZsZpRShAqA5Hvpf2OEZzJP6Y3OjtABG23SGtaQCY=' 
WHERE 
  key_id = '8c33e2e921657c78c331d7a3a791497bc5053b5308c13c429952790a73145905' 
  AND (
    token = 'DunZsZpRShAqA5Hvpf2OEZzJP6Y3OjtABG23SGtaQCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039