UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j1Mqglth8NfxfZ7VhaWFzdtzhneOl/KWFhbyd85DFQw=' 
WHERE 
  key_id = '5e26dfd902cdbfad8c2ba3d37b79ecfe4a78011515b78ca9771f7854bdcad2f9' 
  AND (
    token = 'j1Mqglth8NfxfZ7VhaWFzdtzhneOl/KWFhbyd85DFQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026