UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pCMkCQ9dtDidS0arv5r0M91rxkomd5iIR1VlKyR3loo=' 
WHERE 
  key_id = '344fa66a9c72e5077ec41f69419dae31e2caa297a1f00429ad6e998d4ea3dd5e' 
  AND (
    token = 'pCMkCQ9dtDidS0arv5r0M91rxkomd5iIR1VlKyR3loo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046