UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fO8RU2EiNk4KESEfAtJSkR/ijImq7H2rf6MpEBUmrMM=' 
WHERE 
  key_id = '9adc135597e8f5b12d7ed12b57d9b14722079e68154a7f1f5c39ad1a3c616926' 
  AND (
    token = 'fO8RU2EiNk4KESEfAtJSkR/ijImq7H2rf6MpEBUmrMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056