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

Query time 0.00078