UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kxi4hC7/jXvReVMXb3AU6MRvxepWikQA7BAMMJDQxis=' 
WHERE 
  key_id = '990b2df615040ecfcb9c48b612bf1dba5b19ce743805907a64d15a1acbe8447c' 
  AND (
    token = 'Kxi4hC7/jXvReVMXb3AU6MRvxepWikQA7BAMMJDQxis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033