UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z2DIrgbAqZCNv3QNDGeA2XzsVJkFXpQC7tlDtbDfeJU=' 
WHERE 
  key_id = 'fce8cbf1a3dd08a9118c041ecb78d4983c2f8f7acc7d965023c660f44aaf9052' 
  AND (
    token = 'z2DIrgbAqZCNv3QNDGeA2XzsVJkFXpQC7tlDtbDfeJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017