UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XcHpDF8BH1RYWlTluPAM9PTeNQX/xf+UhJxBoGvniWw=' 
WHERE 
  key_id = '09e26b44014acc8357928de17bea81310d266d1b24f9da92bc60361562af8b4e' 
  AND (
    token = 'XcHpDF8BH1RYWlTluPAM9PTeNQX/xf+UhJxBoGvniWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039